// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios';

Vue.prototype.$http = axios;
axios.interceptors.request.use(config => {
  // console.log(config)
    return config
}, error => {
    return Promise.reject(error)
})
// http响应拦截器
 axios.interceptors.response.use(data => {
    // console.log(data)
    // console.log(data.data.code)
    if(data.data.code==-1){
        window.location.href = './error404.vue';
    }
    return data
}, error => {
    return Promise.reject(error)
})


import $ from 'jquery';

import filter from './filter';
filter(Vue);

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    template: '<App/>',
    components: { App }
})
